package models;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.Lob;
import javax.persistence.OneToMany;

import play.db.jpa.Blob;
import play.db.jpa.Model;

/**
 * Une classe pour le type de chaque item ede tourisme
 * @author islam
 *
 */

@Entity
public class Type extends Model {

	public String name;
	

	/*public Blob image;*/
	
	  
	  public Blob image;
	
	/*@Lob
	public byte[] image;
	*/
	@OneToMany(mappedBy="type", cascade=CascadeType.ALL)
	public List<ToursicItem> touristicItems;
	
	public Type(String name){
		this.name = name;
		this.touristicItems = new ArrayList<ToursicItem>();
	}
	
	@Override
	public String toString() {
	    return name;
	}
}
